<template>
	<span class="value">{{_integer}}</span><small>{{_decimal}}</small><span class="unit">{{_unit}}</span>
</template>

<script>
	export default {
		props: {
			value: {
				type: Number,
				default: 0
			},
			unit: {
				type: String,
				default: ''
			},
			fixed: {
				type: Number,
				default: 2
			}
		},
		computed: {
			_integer() {
				return Math.floor(this.value)
			},
			_decimal() {
				return (this.value - Math.floor(this.value)).toFixed(fixed)
			},
			_unit() {
				return this.unit
			}
		}
	}
</script>
<style lang="less">
	
</style>